const Mock = require("mockjs");

export default [
    {
        url: "/api/getUserList",
        method: "get",
        response: () => {
            return Mock.mock({
                code: 200,
                "data|1-20": [
                    {
                        id: "@id",
                        name: "@cname",
                    },
                ],
            });
        },
    },
    {
        url: "/api/getMenuList",
        method: "get",
        response: () => {
            return {
                code: 200,
                data: [
                    {
                        path: "/BasicLayout/Demo",
                        title: "Demo",
                        name: "Demo",
                        iconName: "icon-appstore",
                        isMenu: true,
                        children: [
                            {
                                path: "/BasicLayout/Demo/Table",
                                component: "/pages/Demo/Table/index",
                                name: "Demo-Table",
                                title: "表格列筛选",
                                isMenu: true,
                                keepAlive: true,
                                iconName: "icon-Console-SQL",
                            },
                            {
                                path: "/BasicLayout/Demo/RichSearch",
                                component: "/pages/Demo/RichSearch/index",
                                name: "RichSearch",
                                title: "高级筛选",
                                isMenu: true,
                                keepAlive: true,
                                iconName: "icon-Report",
                            },
                            {
                                path: "/BasicLayout/Demo/Anchor",
                                component: "/pages/Demo/Anchor/index",
                                name: "Demo-Anchor",
                                title: "锚点",
                                isMenu: true,
                                keepAlive: true,
                                iconName: "icon-pointmap",
                            },
                            {
                                path: "/BasicLayout/Demo/DeptPage",
                                component: "/pages/Demo/DeptPage/index",
                                name: "Demo-DeptPage",
                                title: "部门管理",
                                isMenu: true,
                                keepAlive: true,
                                iconName: "icon-calendar-check",
                            },
                            {
                                path: "/BasicLayout/Demo/Icon",
                                component: "/pages/Demo/IconPage/index",
                                name: "Demo-IconPage",
                                title: "图标列表",
                                isMenu: true,
                                keepAlive: true,
                                iconName: "icon-audit",
                            },
                        ],
                    },
                ],
            };
        },
    },
    {
        url: "/api/getDept",
        method: "get",
        response: () => {
            return Mock.mock({
                code: 200,
                "data|1-10": [
                    {
                        id: "@guid",
                        dept: "@ctitle",
                        "children|1-10": [
                            {
                                id: "@guid",
                                dept: "@ctitle",
                            },
                        ],
                    },
                ],
            });
        },
    },
    {
        url: "/api/getUserInfo",
        method: "get",
        response: () => {
            return Mock.mock({
                code: 200,
                data: {
                    id: "@id",
                    name: "@cname",
                    dept: "xx部门",
                },
            });
        },
    },
    {
        url: "/api/userLogin",
        method: "get",
        response: () => {
            return Mock.mock({
                code: 200,
                result: "@guid",
            });
        },
    },
    {
        url: "/api/getDict",
        method: "get",
        response: () => {
            return Mock.mock({
                code: 200,
                "data|20": [{ id: "@id", value: "@id", label: "@cname" }],
            });
        },
    },
    {
        url: "/api/getTableList",
        method: "post",
        response: () => {
            return Mock.mock({
                code: 200,
                data: {
                    "records|20": [
                        {
                            id: "@id",
                            name: "@cname",
                            sfzh: "@id",
                            date: "@date('yyyy-MM-dd')",
                            city: "@city",
                            desc: "@cparagraph",
                        },
                    ],
                    total: 122,
                },
            });
        },
    },
    {
        url: "/api/getTreeDept",
        method: "post",
        response: () => {
            return Mock.mock({
                code: 200,
                "data|10": [
                    {
                        id: "@guid",
                        name: "@cword(4)",
                        "children|13": [
                            {
                                id: "@guid",
                                name: "@cword(4)",
                            },
                        ],
                    },
                ],
            });
        },
    },
    {
        url: "/api/getUserList",
        method: "post",
        response: () => {
            return Mock.mock({
                code: 200,
                data: {
                    "records|20": [
                        {
                            id: "@guid",
                            name: "@cname",
                            dept: "@cword(4)",
                        },
                    ],
                    total: 991,
                },
            });
        },
    },
];
